using System;
using System.Runtime.CompilerServices;
using UnityEngine;

public class NewMainMenu_CheatCode : MonoBehaviour
{
	private KeyCode[] konamiCode;

	[SerializeField]
	private AudioClip UnlockSFX;

	private int currentIndex;

	private void Update()
	{
		if (!Input.anyKeyDown)
		{
			return;
		}
		if (Input.GetKeyDown(konamiCode[currentIndex]))
		{
			currentIndex++;
			if (currentIndex >= konamiCode.Length)
			{
				UnlockGambling();
				currentIndex = 0;
			}
		}
		else
		{
			currentIndex = 0;
		}
	}

	private void UnlockGambling()
	{
		PlayerPrefs.SetInt("UnlockedGambling", 1);
		PlayerPrefs.Save();
		CutsceneUtils.PlaySound(UnlockSFX);
		Debug.Log((object)"Gambling unlocked!");
	}

	public NewMainMenu_CheatCode()
	{
		KeyCode[] array = new KeyCode[10];
		RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
		konamiCode = (KeyCode[])(object)array;
		((MonoBehaviour)this)._002Ector();
	}
}
